#include "sharedresources.hpp"

int main()
{
    int shmid=CreateShmid();

    char* shmaddr=(char*)shmat(shmid,nullptr,0);

    Init init;

    int fd=open(FIFO_FILE,O_RDONLY);
    while(true)
    {
        char c;
        int n=read(fd,&c,1);
        if(n==0) break;
        
        cout<<"You Say:"<<shmaddr<<endl;
    }

    shmdt(shmaddr);

    shmctl(shmid,IPC_RMID,nullptr);

    return 0;
}